<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>主页 | 米尔豪斯酒店网上订餐</title>
    <link rel="stylesheet" type="text/css" href="../css/index.css">

    <script type="text/javascript">
        function hot_sale_addcart(id) {
            window.location.href = "hot_sale_addcart.php?id="+id;
        }
    </script>
</head>
<body>
<div class="all">
    <div class="home">
        <div class="header">
            <div class="header1">
            	<div class="name">
            		<a href="index.php"><h1>米尔豪斯</h1></a>
            	</div>
            	<div class="guide">
            		<ul>
            			<li><a href="cart.php">购物车</a></li>
            			<li><a href="../register.html">注&nbsp;册</a></li>
            			<li><a href="../login.html">登&nbsp;陆</a></li>
            			<li><a href="zhongcan_order.php">点&nbsp;餐</a></li>
            			<li><a href="consult.php">留&nbsp;言</a></li>
            			<li><a href="index.php">主&nbsp;页</a></li>
            		</ul>
            	</div>
            </div>
        </div>
        <div class="middle">
        	<div class="middle1">
        		<h1>米尔豪斯网上订餐</h1>
        		<h2>电话 : 1234567890</h2>
        	</div>
        </div>
        <?php
        session_start();
        header("Content-type:text/html;charset=utf-8");
        include "../../lib/DB.php";
        $db = new DB();
        $cat = $db->table('classification')->select();
        $goods = $db->table('goods')->where(['is_hot' => 1])->select();
        $url = $_SERVER['SERVER_NAME']."/houtai/php/goods/";
        ?>
        <!--分类展示-->
        <div class="bottom">
        	<div class="bottom1">
        		<ul>
                    <?php foreach($cat as $k => $v):?>
            		<li><a href="zhongcan_order.php?cid=<?php echo $v['cid']?>"><?php echo $v['cname']?></a></li>
                    <?php endforeach;?>
            	</ul>
        	</div>
        </div>
        <div class="bottom2">
        	<img src="../img/border.png" alt="底线">
        </div>
    </div>
    
    <div class="process"></div>

    <div class="popular">
    	<div class="popular1">
    		<img src="../img/border_hwork.png" alt="底线">
    	</div>
    	<div class="popular2">
    		<h1>热卖食品</h1>
    		<p>这些菜品都是本店最受欢迎的<br>其中包括厨师长和曾经的本店顾客推荐总结出来的</p>
       
            <form action="hot_sale_addcart.php" method="post">

                <?php foreach ($goods as $k => $items):?>
                <div class="food">
                    <ul>
                        <li>

                            <img src="//<?php echo $url.$items['goods_url'] ?>" width="192" height="161">
                            <div class="card">
                                <h2><?php echo $items['goods_name']?></h2>
                                <span><p><?php echo $items['price']?>￥&nbsp;&nbsp;1份</p></span>

                                <a href="javascript:hot_sale_addcart(<?php echo $items['gid']?>)">加入购物车</a>
                            </div>
                        </li>
                    </ul>
                </div>
                <?php endforeach;?>

            </form>
    		
    	</div>
    </div>
</div>

<div class="footer">
    <h1>欢迎来到米尔豪斯酒店订餐</h1>
</div>
</body>
</html>